home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / b / black_belt / blackbelt.dms / blackbelt.adf / Game.AMOS / Game.amosSourceCode < prev    next >
AMOS Source Code  |  1990-08-11  |  5KB  |  182 lines

  1. Rem ***Black Belt v1.0***
  2. Rem **By Simon Walklate**
  3. Rem Variable A is the power  
  4. Rem Variable D is the difficulty (the higher the easyer) 
  5. Rem Variable p is a counter so the computer knows when it should -1 from A 
  6. Rem Varibles X and Z Stops the player from pushing the same way twice  
  7. Rem Variable B is the damage to the wooden block 
  8. Rem Variable T is the time limit 
  9. Rem Variable S is score
  10. Rem variable r is the hits the block takes 
  11. Rem Varible J$ is Easy, Hard or Medium 
  12. Rem Variable q is a counter for when to change title screen
  13. Rem Variable w is to tell which title screen is being displayed
  14. Rem Variable h tells the computer which difficulty level has been selected 
  15. Rem Variable q$ is EASY,MEDI, or HARD
  16. Rem variable k tells the computer whether or not screen 1 is switched on 
  17. Rem Variable V tells the computer not to give you ran out of time after the bonus
  18. Close Workbench 
  19. Close Editor 
  20. Screen Open 0,320,200,16,Lowres
  21. Rem Set variables, load screens and samples etc. 
  22. BEG:
  23. P=0
  24. Global P
  25. V=0
  26. Global V
  27. K=0
  28. Global K
  29. W=0
  30. Global W
  31. Q=0
  32. Global Q
  33. T=0
  34. Global T
  35. S=0
  36. Global S
  37. Curs Off 
  38. Rem show title screen and alternate between the two
  39. If K=1 Then Cls : Screen Close 1
  40. Hide On 
  41. Load "music.abk"
  42. Music 1
  43. Load "sprites.abk"
  44. Load Iff "title.pic",0
  45. Do 
  46. If W=0 and Q=200 Then Load Iff "title2.pic",0 : W=1 : Q=0
  47. If W=1 and Q=200 Then Load Iff "title.pic",0 : W=0 : Q=0
  48. Q=Q+1
  49. If Fire(1) Then Music Off : Cls : Paper 0 : Pen 4 : Get Sprite Palette : Goto DIFF
  50. Rem Flash to the music routine 
  51. A=Vumeter(0)
  52. B=Vumeter(1)
  53. C=Vumeter(2)
  54. D=Vumeter(3)
  55. If A>32 Then Led On : Wait 1
  56. If A<32 Then Led Off : Wait 1
  57. If B>32 Then Led On : Wait 1
  58. If B<32 Then Led Off : Wait 1
  59. If C>32 Then Led On : Wait 1
  60. If C<32 Then Led Off : Wait 1
  61. If D>32 Then Led On : Wait 1
  62. If D<32 Then Led Off : Wait 1
  63. Loop 
  64. DIFF:
  65. Led Off 
  66. Cls 
  67. Double Buffer 
  68. Bob 1,150,100,1
  69. Channel 1 To Bob 1
  70. H=0
  71. Screen Open 1,520,25,2,Hires : K=1
  72. Rem Select Difficulty level
  73. Do 
  74. Screen 0
  75. If H>2 Then H=2
  76. If H<0 Then H=0
  77. If H=0 Then Q$="EASY"
  78. If H=1 Then Q$="MEDI"
  79. If H=2 Then Q$="HARD"
  80. If Fire(1) and H=0 Then Goto BACKGROUND
  81. If Fire(1) and H=1 Then Goto BACKGROUND
  82. If Fire(1) and H=2 Then Goto BACKGROUND
  83. If Jleft(1) and H>0 Then Amal On 1 : Sam Play 2 : Wait 74 : H=H-1
  84. If Jright(1) and H<2 Then Amal On 1 : Sam Play 2 : Wait 74 : H=H+1
  85. Global H
  86. Screen 1
  87. Curs Off 
  88. Locate 0,0 : Centre "Choose difficulty level"
  89. Locate 0,1 : Centre Q$
  90. Amal 1,"Anim 1,(1,4)(2,4)(3,4)(4,4)(5,4)(6,4)(7,4)(8,4)(9,10)(8,4)(7,4)(6,4)(5,4)(4,4)(3,4)(2,4)(1,4)"
  91. Loop 
  92. BACKGROUND:
  93. Cls 
  94. Load "samples.abk"
  95. Load Iff "background",0
  96. Double Buffer 
  97. STAR:
  98. Screen Open 1,520,17,2,Hires : K=1
  99. Screen 1 : Curs Off : Hide On : Screen 0
  100. Paper 0
  101. Pen 1
  102. Screen 0
  103. Paper 0
  104. Pen 4
  105. If H=0 Then T=500
  106. If H=1 Then T=400
  107. If H=2 Then T=300
  108. Global T
  109. B=0
  110. Global B
  111. If H=0 Then D=5
  112. If H=1 Then D=3
  113. If H=2 Then D=2
  114. Global D
  115. A=0
  116. Global A
  117. L=0
  118. Global L
  119. X=1
  120. Global X
  121. Z=1
  122. Global Z
  123. If H=0 Then R=50
  124. If H=1 Then R=70
  125. If H=2 Then R=100
  126. Screen 0
  127. Channel 0 To Bob 1 : Channel 1 To Bob 1 : Channel 2 To Bob 1
  128. Rem MAIN LOOP
  129. Do 
  130. L=L+1
  131. T=T-1
  132. Rem Update screen 1
  133. Screen 1
  134. Cls 
  135. Locate 8,0 : Print "Score:";S
  136. Locate 23,0 : Print "Power:";A : Locate 38,0 : Print "Time:";T : Locate 53,0 : Print "Damage:";B
  137. Screen 0
  138. Bob 1,150,100,1
  139. Amal 0,"Anim 1,(1,4)(2,4)(3,4)(4,4)(5,4)(4,4)(3,4)(2,4)(1,4)"
  140. Amal 1,"Anim 1,(1,4)(2,4)(3,4)(4,4)(5,4)(6,4)(7,4)(8,4)(9,10)"
  141. Amal 2,"Anim 1,(1,4)(2,4)(3,4)(2,4)(1,4)"
  142. If A>100 Then A=100
  143. If A<0 Then A=0
  144. If L=D Then L=0 : A=A-1
  145. If T=0 Then Screen 1 : Cls : Locate 0,0 : Centre "!!!!Time Up!!!!" : Screen 0 : Wait 10 : Proc TRYAGAIN
  146. Rem Check joystick 
  147. If Jleft(1) Then A=A+Z : X=1 : Z=0
  148. If Jright(1) Then A=A+X : Z=1 : X=0
  149. If B=R or B>R Then Screen 0 : Amal On 1 : Sam Play 2 : Wait 100 : Proc BONUS
  150. If Fire(1) and A<10 or Fire(1) and A=10 Then Screen 0 : Amal On 2 : Wait 10
  151. If Fire(1) and A=100 or Fire(1) and A>100 Then B=B+20 : S=S+150 : A=A-100
  152. If Fire(1) and A>90 Then B=B+15 : A=A-90 : S=S+130 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  153. If Fire(1) and A>80 Then B=B+15 : A=A-80 : S=S+115 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  154. If Fire(1) and A>70 Then B=B+15 : A=A-70 : S=S+100 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  155. If Fire(1) and A>60 Then B=B+10 : A=A-60 : S=S+85 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  156. If Fire(1) and A>50 Then B=B+10 : A=A-50 : S=S+70 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  157. If Fire(1) and A>40 Then B=B+10 : A=A-40 : S=S+55 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  158. If Fire(1) and A>30 Then B=B+5 : A=A-30 : S=S+40 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  159. If Fire(1) and A>20 Then B=B+5 : A=A-20 : S=S+25 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  160. If Fire(1) and A>10 Then B=B+5 : A=A-10 : S=S+10 : Screen 0 : Amal On 0 : Sam Play 2 : Wait 30
  161. Loop 
  162. Rem Display either winning or loosing screen 
  163. Procedure TRYAGAIN
  164. Curs Off 
  165. If V=1 Then Load Iff "winner",0 : Screen Open 1,640,25,2,Hires : Screen 1 : K=1 : Curs Off : Locate 0,0 : Centre "!!! You did it !!!"
  166. If V=0 Then Load Iff "looser",0 : Screen Open 1,640,25,2,Hires : K=1 : Screen 1 : Curs Off : Locate 0,0 : Centre "!! You ran out of time !!"
  167. Screen 1 : Locate 30,1 : Print "Your score was";S
  168. Do 
  169. If Fire(1) Then Goto BEG
  170. Loop 
  171. End Proc
  172. Rem Reduce time and add to score 
  173. Procedure BONUS
  174. Do 
  175. Screen 1
  176. Cls 
  177. Locate 8,0 : Print "Score:";S
  178. Locate 23,0 : Print "Power:";A : Locate 38,0 : Print "Time:";T : Locate 53,0 : Print "Damage:";B
  179. If T=0 Then V=1 : Proc TRYAGAIN
  180. If T>0 Then T=T-1 : S=S+1
  181. Loop 
  182. End Proc